//
//  UITableView+YSExtension.h
//  YSWeChat
//
//  Created by MOLBASE on 2018/4/15.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UITableView (YSExtension)

/**
 * 使用以下两个方法注册的cell，identifier和类名保持一致
 * 推荐使用类名做cell的标识符
 * 使用该方法获取identifier字符串：
 * NSString *identifier = NSStringFromClass([UITableViewCell class])
 */
- (void)ys_registerCell:(Class)cls;
- (void)ys_registerNibCell:(Class)cls;
- (void)ys_registerNibCell:(Class)cls forCellReuseIdentifier:(NSString *)reuseIdentifier;

- (__kindof UITableViewCell *)ys_dequeueReusableCell:(Class)cls;
- (__kindof UITableViewCell *)ys_dequeueReusableCell:(Class)cls forIndexPath:(NSIndexPath *)indexPath;

- (void)ys_registerHeaderFooterView:(Class)cls;
- (void)ys_registerNibHeaderFooterView:(Class)cls;
- (void)ys_registerNibHeaderFooterView:(Class)cls forHeaderFooterViewReuseIdentifier:(NSString *)reuseIdentifier;

- (__kindof UITableViewHeaderFooterView *)ys_dequeueReusableHeaderFooterView:(Class)cls;

@end

NS_ASSUME_NONNULL_END
